<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>管理页面</title>
        <link href="images/skin.css" rel="stylesheet" type="text/css" />
        <link href="images/form.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
        {=if $cinfo.settings.is_content=}
        <script type="text/javascript" src="{=$root=}/editor/kindeditor.js"></script>
        <script language="javascript">
            <!--
            KE.show({
                id : 'content',
                //referMethod : 'blog',
                //allowFileManager : false,
                //urlType : 'absolute',
                items : [
                    'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline', 'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'remote_image', 'image', 'link', 'unlink', 'source']
            });
        </script>
        {=/if=}
        <style type="text/css">
            <!--
            body {
                margin-left: 0px;
                margin-top: 0px;
                margin-right: 0px;
                margin-bottom: 0px;
                background-color: #EEF2FB;
            }

            table.listbox{margin-top:10px;background-color: #999; font-size: 12px}
            .listbox tr th{background-color: #EEE; text-align: center}
            .listbox tr td{background-color: #FFF}
            
            /*-- content --*/
            .icontent{width:700px;height:300px;visibility:hidden;}
            -->
        </style>
        <body>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
                    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
                            <tr>
                                <td height="31"><div class="titlebt">{=$cinfo.cname=}</div></td>
                                <td align="right"><a href="{=$base=}/?c=cmslink&space={=$space=}&idx={=$idx=}&page={=$page=}">返回</a></td>
                            </tr>
                        </table></td>
                    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
                </tr>
                <tr>
                    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
                    <td valign="top" bgcolor="#F7F8F9">



                        <div class="form-container">
                            <form action="{=$base=}/?c=cmslink&a=save&space={=$space=}&idx={=$idx=}" method="post" id="cms_form" enctype="multipart/form-data">
                                <input type="hidden" name="id" value="{=$info.id=}" />

                                <p class="legend"><strong>注意:</strong>带*号的为必填字段.(<em>*</em>)</p>

                                <fieldset>

                                    <div><label>标题 <em>*</em></label>
                                        <input type="text" name="title" value="{=$info.title=}" class="tlong must" />
                                    </div>

                                    {=if $cinfo.settings.i_subtitle.flag=}
                                    <div><label>{=$cinfo.settings.i_subtitle.name=} {=if $cinfo.settings.i_subtitle.must=} <em>*</em>{=/if=}</label>
                                        <input type="text" name="subtitle" value="{=$info.subtitle=}" class="tlong must" />
                                        {=if $cinfo.settings.i_subtitle.note=}<strong>{=$cinfo.settings.i_link.note=}</strong>{=/if=}
                                    </div>
                                    {=/if=}

                                    {=if $cinfo.settings.i_link.flag=}
                                    <div><label>{=$cinfo.settings.i_link.name=} {=if $cinfo.settings.i_link.must=} <em>*</em>{=/if=}</label>
                                        <input type="text" name="link" value="{=$info.link=}" class="tlong must" />
                                        {=if $cinfo.settings.i_link.note=}<strong>{=$cinfo.settings.i_link.note=}</strong>{=/if=}
                                    </div>
                                    {=/if=}

                                    {=if $cinfo.settings.i_img.flag=}
                                    {=if $info.id && $info.img=}
                                    <div id="img_show">
                                        <input type="button" onclick="$('#img_input').show();$('#img_show').hide();" value="重新上传图片" /><br />
                                        <img src="{=$root=}/uploads/{=$info.img=}" />
                                        <input type="hidden" name="old_img" value="{=$info.img=}" />
                                        {=if $info.thumb=}
                                        <img src="{=$root=}/uploads/{=$info.thumb=}" />
                                        <input type="hidden" name="old_thumb" value="{=$info.thumb=}" />
                                        {=/if=}
                                    </div>
                                    <div id="img_input"style="display: none;">
                                        <input type="button" onclick="$('#img_input').hide();$('#img_show').show();" value="返回图片" /><br />
                                        {=else=}
                                        <div id="img_input">
                                            {=/if=}
                                            <label>{=$cinfo.settings.i_img.name=} {=if $cinfo.settings.i_img.must=} <em>*</em>{=/if=}</label>
                                            <input type="file" name="image" value="" class="tlong needUpload must" />
                                            {=if $cinfo.settings.i_img.note=}<strong>{=$cinfo.settings.i_img.note=}</strong>{=/if=}
                                            <input type="hidden" name="img_deal" value="{=$cinfo.settings.i_img.deal=}" />
                                            <input type="hidden" name="img_width" value="{=$cinfo.settings.i_img.width=}" />
                                            <input type="hidden" name="img_height" value="{=$cinfo.settings.i_img.height=}" />
                                            {=if $cinfo.settings.thumb.has=}
                                            <input type="hidden" name="thumb_has" value="1" />
                                            <input type="hidden" name="thumb_width" value="{=$cinfo.settings.thumb.width=}" />
                                            <input type="hidden" name="thumb_height" value="{=$cinfo.settings.thumb.height=}" />
                                            {=/if=}
                                        </div>
                                        {=/if=}
                                </fieldset>

                                {=if $cinfo.settings.is_content=}
                                <textarea name="content" id="content" class="icontent">{=$info.content=}</textarea>
                                {=/if=}

                                <div class="buttonrow">
                                    <input type="submit" value="提交" class="button" />&nbsp;&nbsp;
                                    <input type="button" value="取消" class="button" onclick="history.go(-1);" />
                                </div>
                            </form>
                        </div>
                        <script type="text/javascript">

                            setVal('title', '');

                            setVal('link', '');

                            setVal('image', '');
                            initUpload();


                            showGameList(game_list, 'gid');
                            setTimeout(function(){ setValue('gid', ''); }, 60);
    
                            $("#cms_form").submit(function(){
                                var flag = true;
                                var obj = null;
                                var v;
                                $(this).find('.must').each(function(){
                                    v = $(this).val().trim();
                                    if (v == '' || v == '0') {
                                        flag = false;
                                        if (obj == null) {
                                            obj = $(this);
                                        }
                                    }
                                });
                                if (flag == false) {
                                    alert('带 * 项必须填写！');
                                    obj.focus();
                                }
    
                                return flag;
                            });
                        </script>


                    </td>
                    <td background="images/mail_rightbg.gif">&nbsp;</td>
                </tr>
                <tr>
                    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
                    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
                    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
                </tr>
            </table>

            <script type="text/javascript">
                function checkform(form)
                {
                    if (form.space.value == "")
                    {
                        alert("空间不能为空");
                        form.space.focus();
                        return false;
                    }
                    if (form.idx.value == "")
                    {
                        alert("索引不能为空");
                        form.idx.focus();
                        return false;
                    }
                    if (form.cname.value == "")
                    {
                        alert("名称不能为空");
                        form.cname.focus();
                        return false;
                    }
                }
            </script>

        </body>
</html>